<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class db</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class db</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">index.php     Zhuayi 框架DB抽象类</p>
	<ul class="tags">
				<li><span class="field">author:</span> zhuayi</li>
				<li><span class="field">copyright:</span> (C) 2005 - 2010  Zhuayi</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_class---db.class.php.html">/class/db.class.php</a> (line <span class="field">11</span>)
		</p>
		
				
		<pre><a href="../default/zhuayi.html">zhuayi</a>
   |
   --db</pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																						
				<div class="method-definition">
											<span class="method-result">db</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">find</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">array()</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#query" title="details" class="method-name">query</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">bood</span>&nbsp;<span class="var-name">$line</span> = <span class="var-default">false</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#select" title="details" class="method-name">select</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$cachetime</span> = <span class="var-default">''</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#select_all" title="details" class="method-name">select_all</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$limit</span> = <span class="var-default">''</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$cachetime</span> = <span class="var-default">''</span>])
									</div>
														
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#sqls" title="details" class="method-name">sqls</a>
											(<span class="var-type">find</span>&nbsp;<span class="var-name">$sql</span>)
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">17</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">构造函数</p>
	
	<div class="method-signature">
		<span class="method-result">db</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">find</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">array()</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">find</span>
				<span class="var-name">$fields</span><span class="var-description">: 数据库配置文件</span>			</li>
				</ul>
		
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../default/zhuayi.html#method__construct">zhuayi::__construct()</a></dt>
						<dd>构造函数</dd>
					</dl>
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">query</span> (line <span class="line-number">136</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">查询</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			query
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">bood</span>&nbsp;<span class="var-name">$line</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span>			</li>
					<li>
				<span class="var-type">bood</span>
				<span class="var-name">$line</span><span class="var-description">: true为多条记录,false为单条记录</span>			</li>
				</ul>
		
			
	</div>
<a name="methodselect" id="select"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">select</span> (line <span class="line-number">70</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回单挑记录</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			select
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$cachetime</span> = <span class="var-default">''</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$cachetime</span><span class="var-description">: 缓存时间,如果为空，则调用默认缓存时间</span>			</li>
				</ul>
		
			
	</div>
<a name="methodselect_all" id="select_all"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">select_all</span> (line <span class="line-number">33</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">返回一个数组</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			select_all
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$sql</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$limit</span> = <span class="var-default">''</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$cachetime</span> = <span class="var-default">''</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$sql</span><span class="var-description">: SQL语句</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$limit</span><span class="var-description">: 结果数</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$cachetime</span><span class="var-description">: 缓存时间,如果为空，则调用默认缓存时间</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsqls" id="sqls"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">sqls</span> (line <span class="line-number">91</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">组合sql</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			sqls
		</span>
					(<span class="var-type">find</span>&nbsp;<span class="var-name">$sql</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">find</span>
				<span class="var-name">$sql</span><span class="var-description">: 三种模式  ⑴ 双表联合查询,array('account'=&gt;array('gid','*'),'account_group'=&gt;array('id','group_name'))、  键值为表名,第一个参数对应的是表之间连接的字段,一般为外键,第二个参数为要读取出来的字段  ⑵ 单表简单查询:直接赋值表名即可  ⑶ 单表或多表联合复杂查询直接写出sql语句</span>			</li>
				</ul>
		
			
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../default/zhuayi.html">zhuayi</a></span></p>
					<blockquote>
													<span class="method-name"><a href="../default/zhuayi.html#method__construct">zhuayi::__construct()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodapp">zhuayi::app()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodcache">zhuayi::cache()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methoddb">zhuayi::db()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodload_class">zhuayi::load_class()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodload_config">zhuayi::load_config()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodload_modle">zhuayi::load_modle()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodload_tpl">zhuayi::load_tpl()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodrouting">zhuayi::routing()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#methodtest">zhuayi::test()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#method_includes">zhuayi::_includes()</a></span><br>
													<span class="method-name"><a href="../default/zhuayi.html#method_load_class">zhuayi::_load_class()</a></span><br>
											</blockquote>
										
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 11 Apr 2011 09:23:48 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>